﻿using System;
using System.Windows.Controls;

namespace FxWinSuper.UI.Menu
{
	internal class SliderMenuData
	{
		public string Header { get; }

		public Image Icon { get; }

		private Func<Page> GetPageFunc { get; }

		private Page _page;

		public Page CurrentPage
		{
			get
			{
				if (_page == null)
				{
					_page = GetPageFunc();
				}

				return _page;
			}
		}

		public SliderMenuData(string header, Image icon, Func<Page> pageFunc)
		{
			Header = header;
			Icon = icon;
			GetPageFunc = pageFunc;
		}

		public SliderMenuData(string header, Image icon, Page page)
		{
			Header = header;
			Icon = icon;
			_page = page;
		}
	}
}
